
<%@ page import="projetstackoverflow.Author" %>
<%@ page import="projetstackoverflow.Question" %>
<!DOCTYPE html>
<html>
	<head>
		<meta name="layout" content="main">
		<g:set var="entityName" value="${message(code: 'author.label', default: 'Author')}" />
		<title>${authorInstance.pseudo }</title>
	</head>
	<body>
		<div id="show-author" class="content" role="main">
			<h1>${authorInstance.pseudo } (Reputation : ${authorInstance.computeReputation() }) ${authorInstance.admin? " (Admin)":""}</h1>
			<ol class="property-list author">
			
				<g:if test="${authorInstance?.pseudo}">
				<li class="fieldcontain">
					<span id="pseudo-label" class="property-label"><g:message code="author.pseudo.label" default="Pseudo" /></span>
					
						<span class="property-value" aria-labelledby="pseudo-label"><g:fieldValue bean="${authorInstance}" field="pseudo"/></span>
					
				</li>
				</g:if>
			
				<g:if test="${authorInstance?.mail}">
				<li class="fieldcontain">
					<span id="mail-label" class="property-label"><g:message code="author.mail.label" default="Mail" /></span>
					
						<span class="property-value" aria-labelledby="mail-label"><g:fieldValue bean="${authorInstance}" field="mail"/></span>
					
				</li>
				</g:if>
			
			
				<g:if test="${authorInstance?.password}">
				<li class="fieldcontain">
					<span id="password-label" class="property-label"><g:message code="author.password.label" default="Password" /></span>
					
						<span class="property-value" aria-labelledby="password-label"><g:fieldValue bean="${authorInstance}" field="password"/></span>
					
				</li>
				</g:if>
			
				<g:if test="${authorInstance?.profile}">
				<li class="fieldcontain">
					<span id="profile-label" class="property-label"><g:message code="author.profile.label" default="Profile" /></span>
					
						<span class="property-value" aria-labelledby="profile-label">${authorInstance.profile.replace("\r\n", "<br />")}</span>
					
				</li>
				</g:if>
			
				<g:if test="${authorInstance?.registrationDate}">
				<li class="fieldcontain">
					<span id="registrationDate-label" class="property-label"><g:message code="author.registrationDate.label" default="Registration Date" /></span>
					
						<span class="property-value" aria-labelledby="registrationDate-label"><g:formatDate date="${authorInstance?.registrationDate}" /></span>
					
				</li>
				</g:if>
				
				
			</ol>
			<g:link action="list" controller="question" params="${['idAuthor':authorInstance.id]}">
				<g:message code="author.list.nbQuestions" args ="${[authorInstance.messages.findAll{it instanceof Question}.size()]}"/>
			</g:link><br /><br />
			<g:form>
				<g:hiddenField name="id" value="${authorInstance?.id}" />
				<g:if test="${session.author && (session.author.admin || session.author.id == authorInstance.id) }">
					<g:link class="edit" action="edit" id="${authorInstance?.id}"><g:message code="default.button.edit.label" default="Edit" /></g:link>
				</g:if>
			</g:form>
		</div>
	</body>
</html>
